﻿using Behaving;
using Behaving.Actions;
using Behaving.Decorators;
using FluentAssertions;
using NUnit.Framework;

namespace Behaving.Tests.DecoratorTests
{
    [TestFixture]
    public class InverterTests
    {
        [Test]
        public void Inverting_running_returns_running()
        {
            BehaviourTree behaviourTree = new BehaviourTree(new Inverter(new RunningAction()));
            behaviourTree.Tick().Should().Be(RunningState.Running);
        }

        [Test]
        public void Inverting_failure_returns_success()
        {
            BehaviourTree behaviourTree = new BehaviourTree(new Inverter(new FailAction()));
            behaviourTree.Tick().Should().Be(RunningState.Success);
        }

        [Test]
        public void Inverting_success_returns_running()
        {
            BehaviourTree behaviourTree = new BehaviourTree(new Inverter(new SuccessAction()));
            behaviourTree.Tick().Should().Be(RunningState.Failure);
        }
    }
}